# -*- coding: utf-8 -*-
# @Time       : 2019/7/14 上午12:30
# @Author     : Simon
# @Email      :
# @File       : __init__.py.py
# @Software   : PyCharm
# @Description:
import os
__all__=["config"]
class Config:
    PENNDING_ERROR=1000
    FAIL_USER=0
    FAIL_PWD=2
    SUCCESS = 1
    FAIL = 0
    FAIL_EXPIRE=3
    NEW_USER_EXPIRETIME=5*24*60*60 #初始注册过期天数
    MASTER_USER_EXPIRETIME=5*24*60*60#邀请注册人增加的天数

    EXISITS_MT_RELATION_MSG="美团商户已经存在绑定关系"
    EXISITS_ELE_RELATION_MSG = "饿了么商户已经存在绑定关系"
    EXISITS_SHOP="不能重复添加店铺"
    RESPONSE_SUCCESS="成功"
    RESPONSE_FAIL = "失败"
    RESPONSE_PENDING = "未知错误"
    #DB_URI = 'mysql+pymysql://root:bidding@123@121.40.127.140:6989/bidding5?charset=utf8'
    DB_URI = 'mysql+pymysql://qitianmeishi:Gx2q4ttgure7pcVPbgj72dHX8qrku0zp@rm-bp1k31qw94rgtlhp13o.mysql.rds.aliyuncs.com:4320/biddingtest?charset=utf8'
    #DB_URI='mysql+pymysql://root:bidding@123@127.0.0.1:6989/bidding5?charset=utf8'
    #DB_URI = 'mysql+pymysql://qitianmeishi:Gx2q4ttgure7pcVPbgj72dHX8qrku0zp@rm-bp1k31qw94rgtlhp1603.mysql.rds.aliyuncs.com:4320/biddingtest?charset=utf8'
    #DB_URI2 = 'mysql+pymysql://qitianmeishi:bidding@123@rm-bp1k31qw94rgtlhp13o.mysql.rds.aliyuncs.com:3306/biddingsecond?charset=utf8'
    DB_URI2 = 'mysql+pymysql://qitianmeishi:Gx2q4ttgure7pcVPbgj72dHX8qrku0zp@rm-bp1k31qw94rgtlhp13o.mysql.rds.aliyuncs.com:4320/biddingsecond?charset=utf8'
    #DB_URI = 'mysql+pymysql://root:bidding@123@47.94.167.208:6989/bidding5?charset=utf8'
    DB_URI_RESEARCH = 'mysql+pymysql://qitianmeishi:bidding@123@rm-bp1k31qw94rgtlhp1603.mysql.rds.aliyuncs.com:4320/spider?charset=utf8'
    CUT_EXPOSURE=0
    MSG_EXPOSURE_NOT_INCRE_MSG='当前曝光量长时间不上涨，请联系管理人员'
    MSG_NOT_BUSINESS='当前非正常停业'
    MSG_NOT_TUIGUANG='当前非推广状态'
    MSG_OUT_BUDGET='当前推广费用已经超出预算'
    MSG_BALANCE='当前余额为'
    MSG_SEND_URL='/api/v1/sendMsg'
    UA=[

    ]
    LEVEL="DEBUG"
    RESPONSE=dict(code=200,message="",data="")
    MT_TARGET_NUM_INCRE_PER=0.1 #美团预期曝光量低于实际曝光量的这个比例时，上调
    MT_TARGET_NUM_REDUCE_PER=0.1#美团预期曝光量高于实际曝光量的这个比例时，下调
    ELE_TARGET_NUM_INCRE_PER=0.1 #饿了么预期曝光量低于实际曝光量的这个比个时，上调
    ELE_TARGET_NUM_REDUCE_PER = 0.1  # 饿了么预期曝光量高于实际曝光量的这个比例时，下调
    MT_DIRECT_PRICE_INCRE=[0.1,0.6]#美团定向出价上调时的价格临界值
    ELE_DIRECT_PRICE_INCRE = [0.1, 0.6]#饿了么定向出价上调的价格临界值

    MT_DIRECT_PRICE_REDUCE=[0.2,0.7]#美团定向出价下调时价格临界值
    ELE_DIRECT_PRICE_REDUCE = [0.2, 0.7]#饿了么定向出价下调时的价格临界值
    PARAM_ERROR = "参数错误"
    PARAM_ERROR_CODE = 10001
    SAVE_LIST = ['/api/v1/chart/shop/setStatus', '/api/v1/admin/shop/set7daysdata', '/api/v1/admin/shop/mode4set',
                 '/api/v1/admin/shop/mode3set', '/api/v1/admin/shop/mode2set', '/api/v1/admin/shop/mode1set',
                 '/api/v1/admin/changeGuard', '/api/v1/chart/shop/delete', '/api/v1/admin/closeOrOpenShop',
                 '/api/v1/shop/setPrice']
class LocalDebugConfig(Config):
    DB_URI = 'mysql://root:bidding@123@127.0.0.1:6989/bidding?charset=utf8'
    LEVEL = "DEBUG"
cnf_name=os.getenv("env","product")
configEnv={"product":Config,
            "localdebug":LocalDebugConfig}
# cnf_name='localdebug'
config=configEnv[cnf_name]
